 var url="http://xue.ujiuye.com/video-4033038/123?cid=281521&ctype=1#hsn";
function parseUrl(url=""){
    var arr=url.split("://");
    var protocol=arr[0];

    arr=arr[1].split("?");
    var index=arr[0].indexOf("/");
    var host=arr[0].slice(0,index)
    var path=arr[0].slice(index);

    var arr=arr[1].split("#");
    var hash=arr[1];

    var paramarr=arr[0].split("&");
    var param={}
    paramarr.forEach(item => {
        var arr1=item.split("=");
        param[arr1[0]]=arr1[1];
    });
    return {protocol,host,path,hash,param};
}
console.log(parseUrl(url));
